package oop2;

/**
 * @author oldliu
 * @since 1.0
 */
public class Jiaowuchu {
    String name = "工大教务处";

    public void calc1(int java, int c, int db) {
        java += 2;
        c += 2;
        db += 2;
        int avg = (java + c + db) / 3;
        System.out.println("三门课分数是 java:" + java + " c:" + c + " db:" + db + "\n 平均分是:" + avg);
    }

    public void calc2(Student s) {
        s.java += 12;
        s.c += 12;
        s.db += 12;
        s.show();
        int avg = (s.java + s.c + s.db) / 3;
        System.out.println("三门课分数是 java:" + s.java + " c:" + s.c + " db:" + s.db + "\n 平均分是:" + avg);
    }

    //    public void calc2(Student s) {
//        s = new Student();
//        s.java += 12;
//        s.c += 12;
//        s.db += 12;
//        s.show();
//        int avg = (s.java + s.c + s.db) / 3;
//        System.out.println("三门课分数是 java:" + s.java + " c:" + s.c + " db:" + s.db + "\n 平均分是:" + avg);
//    }
    //涨粉
    public void increase(Student[] ar) {
        for (Student s : ar) {
            if (s.c < 70) {
                s.c += 2;
            }
        }
    }
}
